/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.sh.ndt.exam.mapper;

import com.sh.ndt.common.mapper.BaseRowMapper;
import com.sh.ndt.exam.entity.TestHistory;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 *
 * @author Prashanth
 */
public class TestHistoryMapper extends BaseRowMapper {

    @Override
    public Object mapRow(ResultSet rs, int i) throws SQLException {
        TestHistory testHistory;
        
        testHistory = new TestHistory();
        
        testHistory.setTestHistoryId(rs.getLong("test_history_id"));
        testHistory.setUserId(rs.getLong("user_id"));
        testHistory.setTestId(rs.getLong("test_id"));
        testHistory.setResult(rs.getInt("result"));
        testHistory.setTestDate(rs.getDate("test_date"));
        testHistory.setTestName(rs.getString("test_name"));
        testHistory.setPercentageSecured(rs.getDouble("percentage"));
        
        return testHistory;
    
    }
    
}
